﻿<UserControl
    x:Class="InTheHand.ApplicationModel.Search.SearchPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:InTheHand.ApplicationModel.Search"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="80"
    d:DesignWidth="400">

    <UserControl.Resources>
        <Storyboard x:Name="Show">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetY)" Storyboard.TargetName="LayoutRoot">
                <EasingDoubleKeyFrame KeyTime="0" Value="-100">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="Hide">
            <DoubleAnimation Duration="0:0:0.3" To="-100" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetY)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <CubicEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch">
        <Grid.Projection>
            <PlaneProjection/>
        </Grid.Projection>
        <Rectangle x:Name="BackgroundFill" Fill="{StaticResource PhoneBackgroundBrush}" Margin="12,28,12,48"/>
        <TextBox VerticalAlignment="Top" x:Name="SearchBox" HorizontalAlignment="Stretch" Margin="12,28,12,12" InputScope="Search"/>
        <Button x:Name="ActionIcon" Visibility="Collapsed" Padding="-2,-10" HorizontalAlignment="Right" MinWidth="0" Margin="-32,20,16,36" Background="Transparent" BorderBrush="Transparent" Foreground="Black" Click="SearchBox_ActionIconTapped">
            <Button.Transitions/>
            <SymbolIcon Foreground="Black" Symbol="Microphone">
                <SymbolIcon.RenderTransform>
                    <ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
                </SymbolIcon.RenderTransform></SymbolIcon>
        </Button>
    </Grid>
</UserControl>
